#include <stdio.h>
#include <math.h>
#include <stdlib.h>

#include <Windows.h>

#include "smalldll.h"

int foo = 5;

void _cdecl test(void)
{
	printf("ok\n");
}

int main(int argc, char* argv[])
{
	int sum = 0;
	//FILE* f = fopen("test.txt", "wb");
	//fwrite("test", 1, 4, f);
	printf("foo = %p\n", &foo);
	//fclose(f);

	fprintf(stdout, "foo = %p\n", &foo);
	//fflush(stdout);

	//printf("Testing DLL: ");

	atexit(test);

	sd_test();
	

	{
		double x = rand();
		double y = 100 * cos(x);

		sum += (int)y;
	}
	
	printf("Testing atexit: ");
	//fflush(stdout);

	return sum;
}

